package han.cirno.corrupt.components.refresh

interface StatusReceiver {
    fun postStartStatus(name:Int?)
    fun postSuccessStatus(name:Int?)
    fun postFailedStatus(name:Int?,throwable: Throwable)
    fun postAllDone()

    fun BackgroundTask<*>.postStartStatus(){postStartStatus(name)}
    fun BackgroundTask<*>.postSuccessStatus(){postSuccessStatus(name)}
    fun BackgroundTask<*>.postFailedStatus(throwable: Throwable){postFailedStatus(name,throwable)}
    fun BackgroundTask<*>.postAllDone(){ this@StatusReceiver.postAllDone() }
}